Skip to main content

Cyberhaven API

Summary: Steps to test the output of events from the API within the Cyberhaven console. Question_md: How can I test the API Authentication and testing capabilities to validate the output of events from the API within the console?

Answer_md: 1. Create the API key.

  1. In the Cyberhaven Console, navigate toSettings > Users & API keys.

A screenshot of a computerDescription automatically
generated

  1. Select New API Key , enter a Name, select a Role and select a date range during which the API key is valid.

  2. Save it.

  3. Copy the value and save it in a safe place.

A black rectangular object with a white backgroundDescription automatically
generated

  1. Now that we have an API key we have to query the API for an access_token which. Note: This token will need to be refreshed as it expires in 15 min.

If the api-token field has a value set, clear and remove all values before proceeding. No API key applied is the desired state for this initial step.

This can be done in https://console_url/administration/api-specifications#auth

A screenshot of a computerDescription automatically
generated

  1. Go to https://console_url/administration/api-specifications#post-/v2/auth/token/access , click on Example and replace "string" with the API token generated on Step 1, click Try button.

A screenshot of a computerDescription automatically
generated

  1. At this point, all API’s will have the Bearer token, like this and you will be able to test all the available API’s

curl -X GET "<https://console_url/public/v2/event-details>" -H "accept:application/json" -H "Authorization: Bearer token"